global leftMargin,topMargin,rightMargin,bottomMargin
put 8 into leftMargin
put 4 into topMargin
put 10 into rightMargin
put 4 into bottomMargin
textstream field 1
get the result
if it is not empty then put it
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=299 top=300 right=322 bottom=438
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Show Pascal Source
----- HyperTalk script -----
on mouseUp
set the visible of card field 1 to not the visible of card field 1
if the visible of card field 1 is true then
set the name of me to "Hide Pascal Source"
else set the name of me to "Show Pascal Source"
end mouseUp
-- part contents for background part 16
----- text -----
TEXTSTREAM XCMD version 2.0
Kevin Calhoun
NOTE TO USERS OF VERSIONS EARLIER THAN 2.0:
TextStream has been completely rewritten and the parameter list has changed. Please read the complete documentation before replacing earlier versions in your stacks with TextStream 2.0. The revisions were necessary to accommodate users who wanted to use TextStream to print mailing labels.
NOTE TO USERS OF LASERWRITER DRIVER VERSION 5.2:
Under the following circumstance, a fatal system error can occur when using TextStream with Apple's LaserWriter Driver version 5.2. Under Finder or under MultiFinder with background printing turned off, if the currently selected LaserWriter is not present on the network, the LaserWriter Driver may crash when TextStream tells it to close. This crash does not occur if the currently selected LaserWriter is up and running. The problem is in the LaserWriter driver; it was not present in version 5.0, and it is not present in the latest version at this writing, version 6.0.
The TextStream XCMD prints the contents of up to 16 HyperTalk containers using your printer's built-in font. You have the option of telling TextStream how many characters wide you want your left and right margins to be and how many lines tall you want your top and bottom margins to be.
In case of an error, TextStream returns an error message as the Result. Word 1 of this message will be "Error."
TextStream works with both the LaserWriter and the ImageWriter. It is intended primarily for use with eight-and-a-half by eleven inch sheets, although you can use it with smaller sheets by providing appropriate margin settings.
Do not place quotation marks around the names of the containers. Parameters given inside the brackets, such as <notNeeded>, are optional.
SETTING MARGINS
TextStream looks in HyperTalk global variables for margin information. The global variables leftMargin and rightMargin contain the number of characters to skip at the start and the end of each line. The global variables topMargin and bottomMargin are the numbers of lines to skip at the top and the bottom of each page.
If these global variables are empty (or if they contain unreasonable numbers for margins), TextStream will default to 96 chars per line and 63 lines per page, which is as much as either the LaserWriter or the ImageWriter can fit on an eight-and-a-half by eleven inch page.
CHANGE HISTORY
7 March 1988 -- 1.0
7 April 1988 -- 1.2 Prints any container, not just fields.
15 March 1989 -- 1.5 Altered source code for compatibility with MPW Pascal 3.0.
18 June 1989 -- 2.0. Complete rewrite. No longer forces a page feed after printing each container. No longer crashes after PrintField.
-- part contents for card part 1
----- text -----
UNIT TextStreamUnit;
{ TextStream XCMD © 1988-1989 by the Trustees of Dartmouth College }